package com.mingqijia.gassafety.shared.constant;

import lombok.Getter;
import lombok.RequiredArgsConstructor;


@Getter
@RequiredArgsConstructor
public enum OpenCloseEnum {

    OPEN("ON", "开启"),
    CLOSE("OFF", "关闭");

    private final String code;
    private final String name;

    public static OpenCloseEnum getOpenClose(String code) {
        for (OpenCloseEnum openCloseEnum : OpenCloseEnum.values()) {
            if (openCloseEnum.getCode().equals(code)) return openCloseEnum;
        }
        return null;
    }
}
